package com.breeze.components.socket.vo;

import com.alibaba.fastjson2.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * websocket请求消息体
 *
 * @author breeze
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WebSocketRequest {

  private String seq;
  private String cmd;
  private String data;

  public <T> T parseData(Class<T> cls) {
    return JSON.parseObject(this.getData(), cls);
  }
}
